package com.chris.getfile.config;

import com.chris.module.okhttp.OKHttpDataSouce;
import com.chris.module.okhttp.OkHttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
//@ComponentScan({"com.core.okhttpcore"})
public class OKHttpUtilConfig {
    @Autowired(required = false)
    OKHttpDataSouce oKHttpUtilMap;

    @Bean(name = "ok1")
    @Primary
    public OkHttpUtil ok1 () {
       // return  new OkHttpUtil();
        if (oKHttpUtilMap != null)
            return oKHttpUtilMap.getOkHttpUtil("internet");
        return null;
    }

}
